<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class TeamMember extends Model
{
	use HasDateTimeFormatter;

    const MEMBER_STATUS_ON  = 1; //在职
    const MEMBER_STATUS_OFF = 0; //离职

    static $status_list = [
        self::MEMBER_STATUS_ON  => '在职',
        self::MEMBER_STATUS_OFF => '离职',
    ];

    protected $table = 'team_member';

    protected $primaryKey = 'member_id';

    public function department()
    {
        return $this->hasOne(OrgDepartment::class, 'department_id', 'department_id');
    }

    public function team()
    {
        return $this->hasOne(OrgTeam::class, 'team_id', 'team_id');
    }
}
